package com.yuwj.chinaa.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yuwj.chinaa.R;
import com.yuwj.chinaa.entity.EntityOrderWithTrade;

import java.util.List;

/**
 * 交易模块出售列表
 */
public class TradeFragmentSaleAdapter extends BaseQuickAdapter<EntityOrderWithTrade, BaseViewHolder> {
    Context context;

    public TradeFragmentSaleAdapter(Context context, List<EntityOrderWithTrade> datas) {
        super(R.layout.item_ask_to_buy, datas);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder holder, final EntityOrderWithTrade item) {
        holder.setText(R.id.tv_name, item.getUserName() + "");
        holder.setText(R.id.tv_chengj_count, "成交："+item.getTurnoverCount());
        holder.setText(R.id.tv_chengj_lv, "成交率："+item.getTurnoverRate()+"%");
        holder.setText(R.id.tv_xiane, "限额："+item.getLimitMix()+"~"+item.getLimitMax()+" 个");
        holder.setText(R.id.cny, item.getPriceCountRMB() + " CNY");
        holder.setText(R.id.tv_price, "单价："+item.getPriceRMB() + " CNY");
        holder.setText(R.id.tv_tarde_count,"数量："+item.getChinaANumber()+" china-A");
    }

}
